<script setup>

//计算属性
import {computed, ref} from "vue";

const list=ref([1,2,3,4,5,6,7,8])
//基于list派生数据

const res=computed(()=>{
  return list.value.filter(item =>item>4)
})

const arr=ref([])
const  additem=()=>{
  arr.value.push("科目三必过")
}
</script>

<template>
<h3>{{list}}</h3>
  <br/>
<h3>{{res}}</h3>
  <br/>
<h3>{{arr}}</h3>
  <br/>
  <button @click="additem">点击添加数据</button>
</template>

<style scoped>

</style>
